package com.example.moneybook.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.moneybook.pojo.PieData;
import com.example.moneybook.pojo.Bill;
import com.example.moneybook.pojo.PieDetailed;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author: 包
 * @Date: 2023/2/18 20:12
 * Description:
 */
@Mapper
public interface StatisticsMapper extends BaseMapper<Bill> {

    /**
     * 统计每个类型的总收支
     * @param userId
     * @param billDate
     * @param state
     * @return
     */
    public List<PieData> pieByType(String userId, String billDate, int state);
    public List<PieDetailed> pieByTypeIcon(String userId, String billDate, int state);

    /**
     * 统计某一天的总收支
     * @param userId
     * @param day
     * @param state
     * @return
     */
    Integer lastDay(String userId, String day, int state);

    /**
     * 统计某个月的总收支
     * @param userId
     * @param month
     * @param state
     * @return
     */
    Integer lastMonth(String userId, String month, int state);

    /**
     * 查看某类型的账单，并按金额排序
     * @param userId
     * @param billDate
     * @param state
     * @return
     */
    List<Bill> billByMoney(String userId, String billDate,String billType, int state);

    /**
     * 查看某类型的账单，并按时间排序
     * @param userId
     * @param billDate
     * @param state
     * @return
     */
    List<Bill> billByTime(String userId, String billDate, String billType, int state);

    /**
     * 查看某月的所有账单
     * @param userId
     * @param billDate
     * @param state
     * @return
     */
    List<Bill> billByMonth(String userId, String billDate, int state);
}
